/**
 * @Author: hl
 * @Date: 2019/8/16
 * @Last Modified by: hl
 * @Last Modified time:
 */

import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 获取仓库
export const getStorageList = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/Storage/Select`, { params });
// 获取客户
export const getCustomerList = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/queryCustomerType/typeList`, { params });
// 查询新增备件信息
export const getNewPartData = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/findPartForAdd`, { params });
// 查询需要添加的备件信息
export const getaddPartList = (storageCode, partNo) =>
  axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/findPartForAddC`, {
    params: {
      storageCode,
      partNo
    }
  });
// 查询调拨入库单明细
export const showDetailRequest = partAllocateInId => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/Items/${partAllocateInId}`, {});
// 查询供应商信息
export const getCustomerData = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/findPartCustomer`, { params });
// 查询调拨入库单
export const getOrderData = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders`, { params });
// 保存调拨入库单
export const saveOrder = params => axios.post(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/save`, params);
// 入账调拨入库单
export const stockIn = params => axios.post(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/enterRecord`, params);
// 作废调拨入库单
export const deleteOrder = partAllocateInId => axios.delete(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/delete/${partAllocateInId}`, {});
// 打印数据接口
export const printData = partAllocateInId => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/queryPrintInData/${partAllocateInId}`, {});
// 查询借出出库数据
export const queryAllocateoutData = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/allocateout/list`, { params });
